package com.neusoft.hifly.netty.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 配置类
 */
@Component
public class NettyConfig {
	// 是否开启socket
	@Value("${netty.socket.enabled:true}")
	private boolean socketEnabled;

	// socket端口
	@Value("${netty.socket.port:49527}")
	private int socketPort;

	// 是否开启websocket
	@Value("${netty.webSocket.enabled:false}")
	private boolean webSocketEnabled;

	// websocket端口
	@Value("${netty.webSocket.port:49528}")
	private int webSocketPort;

	// websocket路由
	@Value("${netty.webSocket.path:/webSocket}")
	private String webSocketPath;

	// 是否开启日志
	@Value("${netty.log.enabled:false}")
	private boolean logEnabled;

	public boolean isSocketEnabled() {
		return socketEnabled;
	}

	public void setSocketEnabled(boolean socketEnabled) {
		this.socketEnabled = socketEnabled;
	}

	public int getSocketPort() {
		return socketPort;
	}

	public void setSocketPort(int socketPort) {
		this.socketPort = socketPort;
	}

	public boolean isWebSocketEnabled() {
		return webSocketEnabled;
	}

	public void setWebSocketEnabled(boolean webSocketEnabled) {
		this.webSocketEnabled = webSocketEnabled;
	}

	public int getWebSocketPort() {
		return webSocketPort;
	}

	public void setWebSocketPort(int webSocketPort) {
		this.webSocketPort = webSocketPort;
	}

	public String getWebSocketPath() {
		return webSocketPath;
	}

	public void setWebSocketPath(String webSocketPath) {
		this.webSocketPath = webSocketPath;
	}

	public boolean isLogEnabled() {
		return logEnabled;
	}

	public void setLogEnabled(boolean logEnabled) {
		this.logEnabled = logEnabled;
	}

}
